package cn.slg.test;

import cn.slg.module.system.dal.dataobject.wujiang.WuJiangDO;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class main {
    public static void main(String[] args) {
        try {

            // 拿到类对象的静态方法
            Method method = AllSkill.allSkill.get("renDeZaiShi");

            WuJiangDO wuJiangDO = new WuJiangDO();
            wuJiangDO.setBingLi((short) 100);
            System.out.println("武将的兵力" + wuJiangDO.getBingLi());

            // 调用静态方法
            method.invoke(null, wuJiangDO);
            System.out.println("武将的兵力" + wuJiangDO.getBingLi());


        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }

    }
}
